// 计算n x n矩阵中2x2矩阵个数
#include <iostream>
using namespace std;

int main()
{
    int n = 0;
    while(1) {
        cin >> n;
        if (n <= 0) break;
        cout << (n - 1) * (n - 1) << endl;
    }
    return 0;
}